<?php
class indexControl extends control{
    public function index(){
		$db = new mysql('product');
		$db->select();
		$totalnum = $db->affected_rows();
		$page = new page($totalnum,10,7);
		$arr = $page->page_list_current;
		$product = $db->limit($page->limit)->select();
		$pagetotal = $page->total_page;
		$this->assign('totalpage',$pagetotal );
		$this->assign('page',$arr);
		$this->assign('product',$product);

		$db1 = new mysql('news');
		$db1->select();
		$totalnum = $db1->affected_rows();
		$page = new page($totalnum,10,7);
		$news = $db1->limit($page->limit)->select();
		$pagetotal = $page->total_page;
		$this->assign('news',$news);

		$this->display();
    }
}
?>